<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{$Think.config.site.title} - 远程升级</title>
    <meta name="keywords" content="{$Think.config.site.keywords}">
    <meta name="description" content="{$Think.config.site.description}">
    <link href="{$Think.config.site.resource_url}css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/animate.min.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/style.min.css?v=4.0.0" rel="stylesheet">
</head>
<body class="gray-bg">
<div id="show">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <form method="post" class="form-horizontal" id="myform" name="myform" >
                            <div class="alert ">
                                <p>
                                    <input type="file" name="file" id="file">
                                </p>
                                <p>&nbsp;</p>
                                <p><button class="btn btn-primary " type="button" id="bton"><i class="fa fa-check"></i>&nbsp;{:lang('点击上传机柜升级包')}&nbsp;</button></p>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="{$Think.config.site.resource_url}js/jquery.min.js?v=2.1.4"></script>
<script src="{$Think.config.site.resource_url}js/bootstrap.min.js?v=3.3.5"></script>
<script src="{$Think.config.site.resource_url}js/plugins/layer/layer.js"></script>
<script src="{$Think.config.site.resource_url}js/plugins/chosen/chosen.jquery.js"></script>
<script type="text/javascript">
    $(".chosen-select").chosen({disable_search_threshold: 5});
</script>
<script type="text/javascript">
    $(function(){
        $('#bton').click(function(){
            var formdata = new FormData($("#myform")[0]);
            $.ajax({
                type : 'POST',
                url  : '<?php echo \think\Request::instance()->root(); ?>/<?php echo \think\Request::instance()->module(); ?>/Equipment/ota',
                dataType : 'json',
                data : formdata,
                async : false,
                cache: false,
                contentType: false,
                processData: false,
                success : function(result){
                    if(0 == result.code){
                        parent.location.reload();
                        layer.msg(result.msg, {icon: 1});

                    }else{
                        layer.msg(result.msg, {icon: 5});
                    }
                },
                error : function(){
                    layer.msg("{:lang('服务器错误！请稍后重试')}", {icon: 2});
                }
            })
        });
    });
</script>
</body>
</html>